package com.yan.domain;

public class Hero implements Fightable{
    private String name;
    private int level;
    private int experience;
    private int blood;

    public Hero(String name, int level, int experience, int blood) {
        this.name = name;
        this.level = level;
        this.experience = experience;
        this.blood = blood;
    }

    public Hero() {

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public int getExperience() {
        return experience;
    }

    public void setExperience(int experience) {
        this.experience = experience;
    }

    public int getBlood() {
        return blood;
    }

    public void setBlood(int blood) {
        this.blood = blood;
    }

    @Override
    public int attack() {
        int fight = getLevel() * 10;
        return fight;
    }

    @Override
    public void fightOver(boolean flag) {
        if(flag) {
            experience += 10;
        }
    }

    public void status(){
        System.out.println("名字"+name+"等级" + level +"经验" + experience + "血量" + blood);
    }
}
